package com.example.finalwork06.Mapper;

import com.example.finalwork06.Entity.FundFlows;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface FundFlowsMapper {
    @Select("SELECT * FROM STOCK_CONNECT_FUND_FLOWS")
    public List<FundFlows> selectAll();

    @Select("select count(*) from STOCK_CONNECT_FUND_FLOWS where SCFFNAME=#{name}")
    public boolean selectByName(String name);

    @Update("update STOCK_CONNECT_FUND_FLOWS set SCFFBALANCE=#{scffBalance},SCFFUSED=#{scffUsed},SCFFNETPURCHASES=#{scffNetPurchases} where SCFFNAME=#{scffName}")
    public void updateByName(FundFlows fundFlows);

    @Insert("insert into STOCK_CONNECT_FUND_FLOWS(SCFFNAME, SCFFBALANCE, SCFFUSED, SCFFNETPURCHASES) values (#{scffName},#{scffBalance},#{scffUsed},#{scffNetPurchases})")
    public void insertFundFlows(FundFlows fundFlows);

}
